package com.chaochis.springboottestdemo.service.impl;

import com.chaochis.springboottestdemo.mapper.LogMapper;
import com.chaochis.springboottestdemo.model.mapperModel.LogVo;
import com.chaochis.springboottestdemo.model.queryParam.LogParam;
import com.chaochis.springboottestdemo.service.LogService;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("logService")
public class LogServiceImpl implements LogService {

  private final LogMapper logMapper;

  public LogServiceImpl(@Qualifier("logMapper")LogMapper logMapper) {
    this.logMapper = logMapper;
  }

  @Override
  public List<LogVo> getAllList(LogParam logParam) {
    var logVo = new LogVo();
    logVo.setCreateTime(logParam.getCreateDate());
    return this.logMapper.getLogList(logVo);
  }

  @Override
  public void insertData(LogVo logVo) {
    this.logMapper.insertLog(logVo);
  }
}
